<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <!-- TopJUI框架样式 -->
    <link type="text/css" href="/topjui/css/topjui.core.min.css" rel="stylesheet">
    <link type="text/css" href="/topjui/themes/default/topjui.bluelight.css" rel="stylesheet" id="dynamicTheme"/>
    <!-- FontAwesome字体图标 -->
    <link type="text/css" href="/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <link type="text/css" href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <link rel="stylesheet" href="/topjui/css/mymenu.css" type="text/css">
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery.min.js"></script>

    <!--<script type="text/javascript" src="/js/tree/tree.js"></script>-->
    <!-- jQuery相关引用 -->
    <script type="text/javascript" src="/static/plugins/jquery/jquery.cookie.js"></script>
    <!-- TopJUI框架配置 -->
    <script type="text/javascript" src="/static/public/js/topjui.config.js"></script>
    <!-- TopJUI框架核心 -->
    <script type="text/javascript" src="/topjui/js/topjui.core.js"></script>
    <script type="text/javascript" src="/topjui/js/sysutils.js"></script>
    <!-- TopJUI中文支持 -->
    <script type="text/javascript" src="/topjui/js/locale/topjui.lang.zh_CN.js"></script>
    <!-- 首页js -->
    <script type="text/javascript" src="/static/public/js/topjui.index.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/plugins/layui/layui.all.js" charset="utf-8"></script>
    <script type="text/javascript" src="/ztree/js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="/ztree/js/jquery.ztree.excheck.js"></script>
    <script type="text/javascript" src="/js/common/tree.js"></script>
    <script type="text/javascript" src="/js/common/menu.js"></script>
    <script type="text/javascript" src="/js/common/myMap.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=lqVkw7DAWGt8CA9NAzxGWrQq"></script>
</head>

<body>
<div data-toggle="topjui-layout" data-options="id:'index_layout1',fit:true">
    <div id="east" class="banner" data-options="region:'east',border:false,split:false"
         style="width: 250px; padding:0;margin:0; overflow: hidden;">
        <div id="treeTab" class="topjui-tabs" data-options="fit:true,border:false,plain:true">
            <div title="设备列表" style="padding: 3px">
                <div id="p" style="margin-bottom: 5px">
                    <select class="topjui-combobox" name="filterType" id="filterType" style="width: 70px;height: 26px;"
                            data-options="panelHeight:36,value:'牌照号'">
                        <option value="牌照号" selected>牌照号</option>
                    </select>
                    <input id="searchBox" class="topjui-searchbox"
                           style="width: 110px;height: 26px;" autocomplete="off"/>
                    <input id="breash" class="topjui-botton" type="button"
                           style="width: 40px;height: 26px;padding-top: -4px;" value="刷新"/>
                </div>
                <ul id="deviceTree" class="ztree">
                </ul>
                <div id="rightMenu" class="topjui-menu" style='width: 160px;'>
                    <!--<div class="menu-sep"></div>-->
                </div>
            </div>
        </div>
    </div>
    <div id="center" data-options="region:'center',border:false" style="overflow:hidden;">
        <iframe id="mapFrame" scrolling="no" frameborder="0" src="/portal/map"
                style="width: 100%; height: 100%;"></iframe>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){
        $.ajax({
            type: "get",
            url: '/json/config/rightmenu.json',
            success: function (data) {
                var menu = MyMenu.createRightMenu(data);
                DeviceTree.createTree(menu);
                $('#breash').click(function(){
                    //var datas = {ids: DeviceTreeIds};
                    $.ajax({
                        type: "get",
                        url:'/sys/updateTree',
                        //data:datas,
                        success: function (result) {
                            DeviceTree.updateNode(result);
                            add_control(MyMap.getMapHandler().map);
                        }
                    });
                });
            }
        });

        $('#searchBox').searchbox({
            searcher: function (value, name) {
                var filterTypeValue = $("#filterType").combobox('getText');
                var filterType = "";
                if ("牌照号" == filterTypeValue) {
                    filterType = 0;
                }
                DeviceTree.Treefilter(filterType, value);
            },
            prompt: '条件查询',
        });
    });
    //添加控件和比例尺
    function add_control(map){
        var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角，添加比例尺
        var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
        map.addControl(top_left_control);
        map.addControl(top_left_navigation);
        map.enableScrollWheelZoom();
    }
</script>
</html>